package com.neo.office.server.domain.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;

import lombok.*;

@Data
@NoArgsConstructor
@RequiredArgsConstructor
@EqualsAndHashCode(callSuper = false,of = "name")
@TableName(value = "t_department")
@ApiModel(value="Department对象",description = "")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value="id")
    private Integer id;

    /**
     * 部门名称
     */
    @NonNull
    @Excel(name = "部门")
    @TableField(value = "name")
    @ApiModelProperty(value="部门名称")
    private String name;

    /**
     * 父id
     */
    @TableField(value = "parentId")
    @ApiModelProperty(value="父id")
    private Integer parentId;

    /**
     * 路径
     */
    @TableField(value = "depPath")
    @ApiModelProperty(value="路径")
    private String depPath;

    /**
     * 是否启用
     */
    @TableField(value = "enabled")
    @ApiModelProperty(value="是否启用")
    private Boolean enabled;

    /**
     * 是否上级
     */
    @TableField(value = "isParent")
    @ApiModelProperty(value="是否上级")
    private Boolean isParent;

    /**
     * 子部门列表
     */
    @ApiModelProperty(value = "子部门列表")
    @TableField(exist = false)
    private List<Department> children;

    /**
     * 返回结果，存储过程使用
     */
    @ApiModelProperty(value = "返回结果，存储过程使用")
    @TableField(exist = false)
    private Integer result;

}